package com.example.service.impl;

import com.example.dao.TeacherDao;
import com.example.entity.Teacher;
import com.example.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TeacherServiceImpl implements TeacherService {

    @Autowired
    private TeacherDao teacherDao;

    @Override
    public Teacher getTeacherById(Integer id) {
        return teacherDao.findById(id);
    }

    @Override
    public int updateTeacherInfo(Teacher teacher) {
        return teacherDao.updateTeacher(teacher);
    }

    @Override
    public int updateTeacherPassword(Integer id, String newPassword) {
        return teacherDao.updatePassword(id, newPassword);
    }
}